package client

import (
	"easyblog/logicals"
	"easyblog/utils/errmsg"
	"github.com/beego/beego/v2/server/web"
)

type CategoryController struct {
	web.Controller
}

// @router /client/category/hot [get]
func (this *CategoryController) GetHotCategorys() {
	data, code := logicals.DefaultCategory.GetHotCategorys()

	result := map[string]interface{}{
		"status":  code,
		"data":    data,
		"message": errmsg.GetErrmsg(code),
	}
	this.Data["json"] = result

	this.ServeJSON() //返回json格式
}